<?php
namespace api\modules\v1\models\feedback;

use common\models\Functions;
use common\models\Status;
use yii\base\Exception;
use yii\helpers\ArrayHelper;

/**
 * This is the model class for table "goods".
 *
 * @property int $id
 * @property string $name
 */
class FeedbackType extends \common\models\feedback\FeedbackType
{

    public function getType() {
        try {
            $where["status"] = Status::COMMON_RADIO_YES;
            $list = static::getByWhere($where, ["id", "name"]);

            $data['list'] = $list;
            $data['image_max'] = static::getCommonByKey('feedback_image_num');

            return Functions::formatRestAPI(0, '', $data);
        } catch (Exception $e) {
            return Functions::formatRestAPI(1, $e->getMessage());
        }
    }
}
